{
 "cells": [
  {
   "cell_type": "code",
   "id": "4ba557245e7d1ee7",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-09-28T13:40:49.634836Z",
     "start_time": "2025-09-28T13:40:49.618771Z"
    }
   },
   "source": [
    "import numpy as np\n",
    "\n",
    "data = np.array([[1, 2, 3], [4, 5, 6]])\n",
    "float_data = data.astype(np.float32)\n",
    "float_data.dtype.name"
   ],
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'float32'"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 7
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-09-28T13:40:49.496959500Z",
     "start_time": "2025-09-28T09:07:04.687589Z"
    }
   },
   "cell_type": "code",
   "source": [
    "float_data=np.array([1.2,2.9,3.5])\n",
    "int_data=data.astype(np.int32)\n",
    "int_data"
   ],
   "id": "cae4e33d3e8c0f12",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[1, 2, 3],\n",
       "       [4, 5, 6]], dtype=int32)"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 5
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-09-28T13:40:49.505480200Z",
     "start_time": "2025-09-28T09:07:05.298181Z"
    }
   },
   "cell_type": "code",
   "source": [
    "str_data=np.array(['1','2','3'])\n",
    "int_data=str_data.astype(np.int64)\n",
    "int_data"
   ],
   "id": "ba6660d15dd4146e",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([1, 2, 3])"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 6
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.13.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
